/*
 * @Author: guxf
 * @Date: 2021-11-25 12:47:22
 * @Description: 用户相关接口
 */
import request from "@/utils/request.js";
const api = {
	getAll: '/applet/seckill/getAll',
	timeNow: '/applet/seckill/time/now',
	seckill: '/applet/seckill/',
	getByGoodsTypeId: '/applet/seckill/getByGoodsTypeId',
	getDetail: '/applet/seckill/getSeckillDetailByGoodsId/',
	execution: '/applet/seckill/execution',
	getSeckillOrder: '/applet/seckill/getSeckillOrder/'
}
/**
 * @desc 新增或刪除
 * 
 */

export function getAll(e) {
	return request({
		method: "GET",
		url: api.getAll + '/' + e,
	});
}

export function timeNow() {
	return request({
		method: "GET",
		url: api.timeNow,
	});
}

export function getDetail(parameter) {
	return request({
		method: "get",
		url: api.getDetail + parameter
	});
}
export function seckill(parameter) {
	return request({
		method: "get",
		url: api.seckill + parameter
	});
}

export function execution(data) {
	return request({
		method: "POST",
		url: api.execution,
		data,
	});
}

export function getByGoodsTypeId(data) {
	return request({
		method: "POST",
		url: api.getByGoodsTypeId,
		data,
	});
}

export function getSeckillOrder(parameter) {
	return request({
		method: "get",
		url: api.getSeckillOrder + parameter.goodsId + '/' + parameter.detailId
	});
}
